package com.gamificationlibrary.gamificationlibrary.badge;

import java.io.Serializable;
import java.util.ArrayList;

public class BadgeSystem implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -8653945323090855509L;
	/**
	 * 
	 */
	
	private ArrayList<Badge> badges;
	
	public BadgeSystem()
	{
		setBadges(new ArrayList<Badge> ());
	}
	
	public void addBadge(Badge badge)
	{
		badges.add(badge);
	}

	public ArrayList<Badge> getBadges() {
		return badges;
	}

	public void setBadges(ArrayList<Badge> badges) {
		this.badges = badges;
	}
	
	public void setWon(Badge badge)
	{
		for(int i=0;i<badges.size();i++)
		{
			if(badges.get(i).equals(badge))
			{
				badges.get(i).setCurrentState(badge.getStateWon());
			}
		}
	}
	
	public int getNumberBadge()
	{
		return badges.size();
	}
}
